package cn.south.campus.admin.campus.service.impl;

import cn.south.campus.admin.campus.mapper.UserMapper;
import cn.south.campus.admin.campus.model.entity.User;
import cn.south.campus.admin.campus.model.req.UserReq;
import cn.south.campus.admin.campus.model.vo.UserVo;
import cn.south.campus.admin.campus.service.UserService;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import lombok.AllArgsConstructor;
import org.springframework.stereotype.Service;


/**
 * <p>
 * 用户表 服务实现类
 * </p>
 *
 * @author chow
 * @since 2024-11-13
 */
@AllArgsConstructor
@Service
public class UserServiceImpl extends ServiceImpl<UserMapper, User> implements UserService {

    private final UserMapper userMapper;

    @Override
    public IPage<UserVo> selectPage(UserReq userReq) {
        IPage<User> userIPage = userMapper.pageQuery(userReq.getPageDto(), userReq);
        return userIPage.convert(UserVo::convert);
    }

}
